package com.hmkj.admin.controller.permission;

import com.hmkj.admin.controller.BaseController;
import com.hmkj.core.po.system.Role;
import com.hmkj.core.service.system.RoleService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

/**
 * 后台管理员
 */
@Controller
@RequestMapping(BaseController.BASE_URI)
public class AdminController extends BaseController {

    @Resource
    RoleService roleService;

    /**
     * 管理员列表
     *
     * @param modelMap
     * @return
     */
    @RequestMapping("admin/list")
    public String list(ModelMap modelMap) {
        List<Role> list = roleService.selectAll();
        modelMap.addAttribute("roleList", list);
        return getAdminTemplate("admin/admin/list");
    }
}